import pytest

from file.doExl import Dof
from jiSuanQ.jiSq import Class_j
f=r'F:\work\codings\python\pro_test\date\chenghechy.xlsx'
de = Dof()
l = de.domyE(f,'chu', 2, 13, 2, 5)
class TestMyChu():
    @pytest.mark.parametrize('tou,a,b,yq',l)
    def testMyChu(self,tou,a,b,yq):
        cl=Class_j()
        r=cl.myChu(a,b)
        if isinstance(r,float):
            r=round(r,2)
            assert r==yq
        else:
            if isinstance(r,int):
                assert r==yq
            elif (a==''or a is None) or (b==''or b is None):
                assert '空' in yq
            else:
                assert '非法' in yq
